import { BroadCastCall } from "../../broadCast/BroadCastCall";
import { MessageBlock } from "../../../../../Framework/MQ/MessageBlock";
import { SMarryCeremony } from "../../../../../Message/Public/SMarryCeremony";
import { Cache } from "../../../cache/Cache";
import { NetDispatcher } from "../../../../mvc/core/NetDispatcher";
import { ServerCommand } from "../../../mvc/ServerCommand";
//class MarryCeremonyCommand
    
    export  class MarryCeremonyCommand extends BroadCastCall
    {
        constructor(arg1: Object)
        {
            super(arg1);
            return;
        }

        public /* override */ call(arg1: MessageBlock): void
        {
            super.call(arg1);
            var loc1=arg1.messageBase as SMarryCeremony;
            var loc2=Cache.instance.role.entityInfo.name;
            if (loc1.man.name == loc2 || loc1.woman.name == loc2) 
            {
                Cache.instance.marry.isInCeremony = true;
            }
            NetDispatcher.dispatchCmd(ServerCommand.MarryCeremonyCommand, loc1);
            return;
        }
    }
